<template>
	<!-- 弹窗 -->
	<e-popup :show="show" round="20rpx" @close="show = false">
		<view class="no-can-list">
			<view class="e-p-b-24 e-rela e-flex-xy-center">
				<text class="e-font-32 fw-500">{{ $t('classify.查看原因') }}</text>
				<image src="/pages/systemPay/static/close.png" class="no-can-list-img img-28" @tap="show = false">
				</image>
			</view>
			<view class="" v-if="noCanList && noCanList.length">
				<view class="e-p-20 box e-m-b-20" v-for="item in noCanList" :key="item.commodityUrl">
					<view class="e-flex e-m-b-20">
						<view class="img-box e-m-r-20">
							<load-image :size="['162rpx']" radius="20rpx" :src="item.commodityUrl" mode="aspectFit">
							</load-image>
							
						</view>
						<view class="e-flex-1 commodity-box">
							<view class="e-flex-1 e-font-26 c-333 e-m-b-20">
								{{item.commodityName}}
							</view>
							<view class="e-font-26 c-secondary text-right">
								x{{item.commodityCount}}
							</view>
						</view>
					</view>
					<view class="e-font-22 c-red">
						<text v-if="receivingType === 3">{{$t('classify.当前商品不支持闪送')}}</text>
						<text v-else-if="receivingType === 5">{{$t('classify.当前商品不支持配送')}}</text>
						<text v-else-if="receivingType === 1">{{$t('classify.当前商品不支持快递')}}</text>
						<text v-else-if="receivingType === 2">{{$t('classify.当前商品不支持自提')}}</text>
					</view>
				</view>
			</view>
			<view class="" v-if="exceedLimitList && exceedLimitList.length">
				<view class="e-p-20 box e-m-b-20" v-for="item in exceedLimitList" :key="item.commodityUrl">
					<view class="e-flex e-m-b-20">
						<view class="img-box e-m-r-20">
							<load-image :size="['162rpx']" radius="20rpx" :src="item.commodityUrl" mode="aspectFit">
							</load-image>
						</view>
						<view class="e-flex-1 commodity-box">
							<view class="e-flex-1 e-font-26 c-333 e-m-b-20">
								{{item.commodityName}}
							</view>
							<view class="e-font-26 c-secondary text-right">
								x{{item.commodityCount}}
							</view>
						</view>
					</view>
					<view class="e-font-22 c-red">
						<text v-if="receivingType === 3">{{$t('classify.当前商品超出闪送限购数量')}}</text>
					</view>
				</view>
			</view>
			
			<view class="btn e-font-28 c-white e-flex-xy-center bg-primary"  @tap="show = false">
				<text>{{$t('classify.我知道了')}}</text>
			</view>
		</view>
	</e-popup>
</template>
<script lang="ts">
	import {
		defineComponent
	} from 'vue'
	export default defineComponent({
		// #ifdef MP-WEIXIN
		// 将自定义节点设置成虚拟的，更加接近Vue组件的表现
		options: {
			virtualHost: true
		},
		// #endif
	})
</script>
<script setup lang="ts">
	import {computed} from 'vue'
	import type {OrderGoods} from '@/common/request/api'
	
	const props = defineProps<{
		value: boolean,
		noCanList: OrderGoods['deputys'],
		exceedLimitList:OrderGoods['deputys'],
		receivingType: number
	}>()
	
	const emits = defineEmits(['update:value'])
	
	
	
	const show = computed({
		get () {
			return props.value
		},
		set(v){
			emits('update:value',v)
		}
	})

</script>

<style lang="scss" scoped>
	.no-can-list {
		padding: 32rpx 20rpx 22rpx 20rpx;
		max-height: 80vh;
		overflow-y: auto;
		.box {
			background: #F7F7F7;
			border-radius: 20px;
		}

		.commodity-box {
			display: flex;
			flex-direction: column;
		}

		.img-box {
			width: 162rpx;
			height: 162rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
		}

		.no-can-list-img {
			position: absolute;
			top: 10rpx;
			right: 20rpx;
		}
	}
	.btn {
		height: 90rpx;
		border-radius: 46rpx;
		margin-top: 30rpx;
	}
</style>
